package util_lib // Package util_lib  本包区别lib，是自定义 主要包含工具类库
import "strconv"

type Options struct {
	table map[string]string
}

//
func (receiver *Options) put(name, value string) {
	receiver.table[name] = value
}

func (receiver Options) defined(name string) bool {
	_, ok := receiver.table[name]
	return ok
}

func (receiver Options) get(name string) string {
	str, ok := receiver.table[name]
	if ok {
		return str
	} else {
		return ""
	}
}

func (receiver Options) getAsInt(name string) int64 {
	str, ok := receiver.table[name]
	if ok {
		num, err := strconv.ParseInt(str, 10, 64)
		if err != nil {
			return num
		}

	}
	return 0
}

